package cn.kgc.client;
import cn.kgc.pojo.DmOrder;

import cn.kgc.fallback.DmOrderClientFallBack;
import java.util.List;
import java.util.Map;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestBody;
/**
* Created by shang-pc on 2018/5/15.
*/
@FeignClient(name = "dm-order-provider", fallback = DmOrderClientFallBack.class)
public interface RestDmOrderClient {
@RequestMapping(value = "/getDmOrderById",method = RequestMethod.POST)
public DmOrder getDmOrderById(@RequestParam("id") Long id)throws Exception;

@RequestMapping(value = "/getDmOrderListByMap",method = RequestMethod.POST)
public List<DmOrder>    getDmOrderListByMap(@RequestParam Map
<String,Object> param)throws Exception;

@RequestMapping(value = "/getDmOrderCountByMap",method = RequestMethod.POST)
public Integer getDmOrderCountByMap(@RequestParam Map
<String,Object> param)throws Exception;

@RequestMapping(value = "/qdtxAddDmOrder",method = RequestMethod.POST)
public Integer qdtxAddDmOrder(@RequestBody DmOrder dmOrder)throws Exception;

@RequestMapping(value = "/qdtxModifyDmOrder",method = RequestMethod.POST)
public Integer qdtxModifyDmOrder(@RequestBody DmOrder dmOrder)throws Exception;

@RequestMapping(value = "/qddelDmOrder",method = RequestMethod.GET)
public Integer qdtxDelDmOrder(@RequestParam("id") Long id)throws Exception;

    /**
     * 校验这个订单是否支付过
     * @param out_trade_no 订单号
     * @param type  支付类型，支付宝，微信
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "processed",method = RequestMethod.POST)
    public boolean processedPay(@RequestParam("orderNo") String out_trade_no,@RequestParam("type")Integer type) throws Exception;


    @RequestMapping(value = "flushCancelOrder",method = RequestMethod.POST)
    public Integer flushCancelOrder();
}

